<?php  
	namespace Home\Controller;
	use Think\Controller;

	class BuyController extends Controller
	{
		public function index()
		{
			if (empty(I('get.max_id'))) {
				
				$this->error('您访问的页面不存在',2);
				exit();
			}


			$sku 	= M('sku_goods');

			$data 	= $sku->alias('sg')

			->join('__PRODUCT__ pro ON pro.max_id = sg.proudct_id')
			->join('__SKU_CAT__ st ON st.sku_id = sg.sku_id')->where('max_id='.I('get.max_id'))
			->select();

			$max_id  	=	$data[0]['max_id'];

			$detailimg 	= M('detailimg');

			$img	 	= 	$detailimg->where('proudct_id='.$max_id)->select();

			// NSLog($img);


			// NSLog($data);

			$this->assign('data',$data);

			$this->assign('img',$img);

			$this->display();
		}
	}